var tgd = tgd || {};
tgd.Math = tgd.Math || {};

//todo: don't technically need "n", can get it from set.length
tgd.Math.KPermutation = function (n, k, set) {

	if (typeof tgd.Math.KPermutation._initialized == "undefined") {
		//static class method
		tgd.Math.KPermutation.choose = function(n, k) {
			//todo:
		}
	}

	//"private" instance variables
	this._n = n;
	this._k = k;
	this._set = set.sort(function(a,b) { return a - b; });
	this._numPermutations = tgd.Math.KPermutation.choose(this._n, this._k);

	if (typeof tgd.Math.KPermutation._initialized == "undefined") {

		tgd.Math.KPermutation.prototype.getIndex = function(set) {
			//todo: is this needed?
		}

		tgd.Math.KPermutation.prototype.element = function(m) {
			//todo:
		}

		tgd.Math.KPermutation.prototype.toString = function() {
			return this._set.join();
		}

		tgd.Math.KPermutation._initialized = true;
	}
}
